<template>
  <div class="app">
    <button @click="getStudentList">点我获取学生列表</button>
    <button @click="getCarList">点我获取汽车列表</button>
    <button @click="geNews">点我获取新闻</button>
  </div>
</template>

<script>
  import axios from 'axios'

  export default {
    name:'App',
    methods: {
      getStudentList(){
        axios.get('/dev1-api/students').then(
          response => {
            console.log(response.data)
          },
          error => {
            console.log(error.message)
          }
        )
      },
      getCarList(){
        axios.get('/dev2-api/cars').then(
          response => {
            console.log(response.data)
          },
          error => {
            console.log(error.message)
          }
        )
      },
      geNews(){
        axios.get('/toutiao-api/hot-event/hot-board/?origin=toutiao_pc').then(
          response => {
            console.log(response.data.data)
          },
          error => {
            console.log(error.message)
          }
        )
      }
    },
  }
</script>

<style>
  .app {
    background-color: gray;
    padding: 10px;
  }
</style>